package cn.ekuma.epos.analysis.front.ticket.model;

import cn.ekuma.data.ui.swing.AbstractDTOTableModel;
import cn.ekuma.epos.bean.util.sale.TicketLineWarp;

import com.openbravo.bean.sales.TicketLine;
import com.openbravo.pos.base.AppLocal;

public class TicketLineVTableModel extends AbstractDTOTableModel<TicketLine> {
	
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
	TicketLine value = getObj(rowIndex);
	TicketLineWarp wapValue=new TicketLineWarp(value);
	switch (columnIndex) {
	case 0:
		return wapValue.printName()+wapValue.getProductAttSetInstDesc();
	case 1:
		return wapValue.printPrice();
	case 2:
		
		return wapValue.printMultiply();
	case 3:
		return wapValue.printTaxRate();
	case 4:
		return wapValue.printSubValue();
	}
	return null;
}


@Override
public String[] getColumnNames() {
	return new String[] {
			AppLocal.getIntString("label.item"),
			AppLocal.getIntString("label.price"),
			AppLocal.getIntString("label.units"),
			AppLocal.getIntString("label.tax"),
			AppLocal.getIntString("label.value")
			};
}


@Override
public Class<?> getColumnClass(int columnIndex) {
	if(columnIndex==4)
		return Double.class;
	return super.getColumnClass(columnIndex);
}



}
